package com.byxy.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.byxy.dao.OrderDao;
import com.byxy.entity.Order;
@Repository
public class OrderDaoImpl implements OrderDao {
	@Resource
	private SessionFactory sessionFactory;
	@Override
	public void add(Order order) {
		sessionFactory.getCurrentSession().save(order);
	}
	@SuppressWarnings("unchecked")
	@Override
	public List<Order> find() {
		return sessionFactory.getCurrentSession().createCriteria(Order.class).list();
	}
}
